<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title></title>
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/css/common.css">
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Uploadify/uploadify.css">
	<script type="text/javascript" src='__PUBLIC__/Admin/js/jquery-1.7.2.min.js'></script>
	<script type="text/javascript" src='__PUBLIC__/Uploadify/jquery.uploadify.min.js'></script>
	<script type="text/javascript">
		$(function() {
	    $("#upload").uploadify({
	    	buttonText	  :'上传LOGO',
	        height        : 30,
	        swf           : '__PUBLIC__/Uploadify/uploadify.swf',
	        uploader      : '<?php echo U("Common/uploadBrand");?>',
	       		formData : { 'session_id' : '<?php echo session_id();?>' },
	        width         : 100,
	        onUploadSuccess : function(file, data, response){
         		eval("var data = " + data);
         		
         		if (data.status) {
         			var path = '__ROOT__/Uploads/Brand/' + data.path;
         			$('#show img').attr('src', path);
         			$('input[name=logo]').val(data.path);
         		} else {

         		}
        	} 
	    });
	});
	</script>
</head>
<body>
	<div class='status' >
		<span>添加商品品牌</span><a  class='back' href="<?php echo U(index);?>" ><strong>返回品牌列表<b></b></strong></a>
	</div>
	<div>
		<form method='post' action="<?php echo U('runAddBrand');?>"> 
			<table class="table" cellspacing='0px' cellpadding='0px'>
				<tr><th colspan='2' >添加商品品牌</th></tr>
				<tr><td>品牌名称：</td><td class='td_left'><input type='text' class='text' name='name'/></td></tr>
				<tr><td>是否热门：</td><td class='td_left'><input type='radio' name='hot' value='1'/> 是 <input type='radio' name='hot'value='0' checked='checked'/> 否</td></tr>
				<tr><td>LOGO：</td><td class='td_left'>
					<div id='show'>
						<img src=''/>
					</div>
					<input type="file" name='pic' id='upload'/>
					<input type='hidden' name='logo' value=''/>
					</td></tr>
				<tr><td colspan='2' class='td_center'><input type='submit' class='add_btn' value='添加保存'/></td></tr>
			</table>

		</form>
	</div>
</body>
</html>